package com.openNetty.server.nettyclient;

import com.openNetty.common.bean.ComRequest;
import com.openNetty.common.bean.SendMsgFuture;

/**
 * 链接远程服务器
 * @author zhenggm
 * @create 2017-08-21 下午 4:29
 **/


public class ConnectNode {

    public SendMsgFuture start(ComRequest rsmRequest) {
        return startNode(rsmRequest);
    }

    public SendMsgFuture startNode(ComRequest rsmRequest) {
        String ip = rsmRequest.getBackNode().getAddress();
        String port = rsmRequest.getBackNode().getPort();
        return new NettyClient().connect(Integer.valueOf(port), ip, rsmRequest);
    }

}
